﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EasyMapping.Core
{
    public class ParameterProperty
    {
        public ParameterProperty()
        { }

        public ParameterProperty(string name, object value)
        {
            this.Name = name;
            this.Value = value;
        }

        public string Name { get; set; }
        public object Value { get; set; }

    }

    public class ParameterPropertyArray
    {
        private Dictionary<string, ParameterProperty> _map = new Dictionary<string, ParameterProperty>();
        public ParameterPropertyArray(ParameterProperty[] arr)
        {
            foreach (var item in arr)
            {
                _map.Add(item.Name, item);
            }
        }

        public ParameterProperty this[string name]
        {
            get
            {
                ParameterProperty property = default(ParameterProperty);
                if (_map.TryGetValue(name, out property))
                {
                    return property;
                }
                return null;
            }
        }
    }
}
